package com.zd.common.common.enums;

/**
 * 数据库 状态字段
 * 
 * @author lishi
 * @date 2018年11月1日 下午12:03:05
 */
public enum StatusEnum {
	delete(-1, "已删除"),
	invalid(0, "无效"),
	valid(1, "有效");

	private int key;
	private String value;

	private StatusEnum(int key, String value) {
		this.key = key;
		this.value = value;
	}

	public int getKey() {
		return key;
	}


	public void setKey(int key) {
		this.key = key;
	}


	public String getValue() {
		return value;
	}


	public void setValue(String value) {
		this.value = value;
	}


	public static StatusEnum get(int key) {
		for (StatusEnum status : StatusEnum.values()) {
			if (status.getKey() == key) {
				return status;
			}
		}
		return null;
	}
}
